//
//  ZTDownloadCollectionViewCell.m
//  XMLYFM
//
//  Created by dllo on 15/12/24.
//  Copyright © 2015年 zzl. All rights reserved.
//

#import "ZTDownloadCollectionViewCell.h"
#import <Masonry.h>

#define WIDTH [UIScreen mainScreen].bounds.size.width

#define HEIGHT [UIScreen mainScreen].bounds.size.height

@implementation ZTDownloadCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self createCell];
    }
    
    return self;
}

- (void)createCell
{

    
    self.iconImageView = [UIImageView new];
    self.iconImageView.backgroundColor = [UIColor whiteColor];
    self.iconImageView.layer.masksToBounds = YES;
    self.iconImageView.layer.cornerRadius = WIDTH / 16;
    self.iconImageView.layer.borderColor = [UIColor colorWithRed:0.98 green:0.56 blue:0.43 alpha:1].CGColor;
    self.iconImageView.layer.borderWidth = 1.5;
    [self.contentView addSubview:self.iconImageView];
    
    [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.offset(20);
        make.top.offset(20);
        make.width.offset(WIDTH / 8);
        make.height.offset(WIDTH / 8);
        
    }];
    

    
    
    self.titleLabel = [UILabel new];
    self.titleLabel.backgroundColor = [UIColor clearColor];
//    self.titleLabel.center = CGPointMake(self.iconImageView.center.x, self.iconImageView.frame.origin.y+self.iconImageView.frame.size.height + 20);
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.font = [UIFont systemFontOfSize:15];
    [self addSubview:self.titleLabel];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.offset(10);
        make.top.equalTo(self.iconImageView.mas_bottom).offset(20);
        make.width.offset(WIDTH / 8 + 20);
        make.height.offset(20);

        
    }];
    
    
}


@end
